﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Windows.Input;
using Microsoft.Practices.Composite.Presentation.Commands;
using Microsoft.Practices.Composite.Regions;

namespace BlueMarble.Genesis.View
{
    public class MainViewModel : IMainViewModel, INotifyPropertyChanged
    {
        protected IRegionManager regionManager;

        public MainViewModel(IMainView view, IRegionManager RegionManager)
        {
            this.regionManager = RegionManager;

            this.View = view;
            this.View.ViewModel = this;
        }

        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;

        private void NotifyPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler Handler = PropertyChanged;
            if (Handler != null) Handler(this, new PropertyChangedEventArgs(propertyName));
        }

        #endregion

        #region IMainViewModel Members

        public IMainView View { get; set; }
        public IRegionManager RegionManager
        {
            get
            {
                return regionManager;
            }

            set
            {
                regionManager = value;
            }
        }

        #endregion
    }
}
